<template>
	<view>
		111111111111111111111111
		<!-- style="position: absolute;z-index: -1;top:-2000upx;left: -1000upx;" -->
		 <tki-qrcode
		 
		    ref="qrcode"
		    cid="qrcode1"
			lv='0'
		    :val="val"
		    @result="qrR" />
	</view>
</template>

<script>
	import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
	export default {
		data() {
			return {
				val:"http://o.cxbyi.com/mp?page=goods&id=1&share=2"
			}
		},
		components: {tkiQrcode},
		methods: {
			qrR(e){
				console.log(e)
			},
			queryUrl(name){
				var _search = this.val.split('?')[1];
				var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)");
				    var r=_search.match(reg);
				    if(r!=null) {
				    	return decodeURIComponent(r[2]); 
				    } else {
				    	return null;
				    }
			}
		},
		onLoad() {
			this.$refs.qrcode._makeCode();
			console.log(this.queryUrl('page'))
		}
	}
</script>

<style>

</style>
